import Mock from "mockjs";

const data = Mock.mock({
  // 属性 list 的值是一个数组，其中含有 1 到 10 个元素
  "list|1-10": [
    {
      "id|+1": 1, // id 从 1 开始自增。
      name: "@cname",
      "age|15-25": 1,
      city: "@county(true)", // 传入true表示具体到省份市区
      email: "@email(qq.com)",
      // date: Mock.Random.date(),
      date: "@date()",
      ids: "@increment(1)",
      "company|1": ["腾讯", "阿里巴巴", "CSDN", "百度", "拼多多", "京东"], // 在指定的数组中选一个
      description: "@word(40)", // 生成40个字符
      logo: '@image("200x200","#ffffff","#23272E","LOGO")',
    },
  ],
});

Mock.mock(/home\/getData/,'get', function () {
  return data;
});
